#pragma once

#include <string>
#include <vector>
#include <memory>
#include "onvif_types.h"
#include "soap/soap_message.h"

namespace El {
namespace Onvif {

/**
 * @brief 简化的ONVIF PTZ服务实现
 */
class PTZService : public ISoapHandler {
public:
    PTZService();
    virtual ~PTZService() = default;

    // ISoapHandler接口实现
    std::string HandleRequest(const SoapMessage& request, const std::string& remoteAddr) override;

private:
    // 具体的SOAP处理方法
    std::string HandleGetNodes(const SoapMessage& message);
    std::string HandleGetStatus(const SoapMessage& message);
    std::string HandleAbsoluteMove(const SoapMessage& message);
    std::string HandleRelativeMove(const SoapMessage& message);
    std::string HandleContinuousMove(const SoapMessage& message);
    std::string HandleStop(const SoapMessage& message);
    std::string HandleGetPresets(const SoapMessage& message);
    std::string HandleSetPreset(const SoapMessage& message);
    std::string HandleGotoPreset(const SoapMessage& message);

    // 辅助方法
    std::string EscapeXml(const std::string& input) const;
};

} // namespace Onvif
} // namespace El